{% load getattr %}

{{entity|getattr:model.Metadata.label}}

<a href="/{{model.Metadata.name}}/">back to {{model.Metadata.display_name}}</a>

<form method="POST">
{%for item in model.Metadata.form%}
<div style="padding:5px;">
<span>{{item.1}}:</span>
<input name="{{item.0}}" value="{{entity|getattr:item.0}}"/>
</div>
{%endfor%}
<input type="submit" value="{%if entity.key.id_or_name%}Update{%else%}Add{%endif%}"/>
<input type="button" value="Delete" onclick="javascript:window.location.href='delete/';"/>
<input type="reset" value="Cancel"/>
</div>
</form>